package com.orphan.audit.controller;


import com.orphan.audit.po.UserDetail;
import com.orphan.audit.po.UserFreeze;
import com.orphan.audit.service.IUserDetailService;
import com.orphan.audit.service.IUserFreezeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yichen
 * @since 2021-07-14
 */
@RestController
@RequestMapping("/freeze")
public class UserFreezeController {

    @Autowired
    public IUserFreezeService iUserFreezeService;

    @GetMapping("/getAll")
    private List<UserFreeze> getAll(){
        List<UserFreeze> userFreezes = iUserFreezeService.getAll();
        return userFreezes;
    }
    @GetMapping("/update/{uId}/{status}")
    public boolean update(@PathVariable("uId") Integer uId,@PathVariable("status") String status){
        UserFreeze userFreeze = new UserFreeze();
        userFreeze.setUId(uId);
        userFreeze.setStatus(status);
        System.out.println("userFreeze = " + userFreeze);
        boolean update = iUserFreezeService.update(userFreeze);
        return update;
    }

}
